import gulp from 'gulp'
import less from 'gulp-less'
import fs from 'fs'

const { series, src, dest } = gulp

const css = () => {
  return src("./src/**.less").pipe(less())
    .pipe(dest("dist/css"))
}

const clean = async (cb) => {

  console.log('删除dist目录', process.cwd());
  // 删除dist目录

  fs.rmdirSync('./dist')

  cb()
}


const deleteDirectory = (dir) => {
  // if (fs.existsSync(dir))
}

export default series(clean,css)